package cn.edu.tju.elm.model.wallet;

import cn.edu.tju.core.model.BaseEntity;
import jakarta.persistence.*;
import java.math.BigDecimal;

/**
 * 表示钱包的奖励和手续费规则。
 * 字段说明：
 * id          - 规则唯一标识
 * ruleType    - 规则类型：DEPOSIT-充值, WITHDRAW-提现
 * ruleName    - 规则名称
 * condition   - 规则条件（如充值满多少金额）
 * value       - 规则值（如奖励金额或手续费率）
 * isActive    - 是否激活
 */

@Entity
@Table(name = "wallet_rule")
public class WalletRule extends BaseEntity{
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    
    @Column(name = "rule_type", nullable = false, length = 20)
    private String ruleType;
    
    @Column(name = "rule_name", nullable = false, length = 100)
    private String ruleName;
    
    @Column(name = "condition_value", precision = 15, scale = 2)
    private BigDecimal conditionValue;
    
    @Column(name = "rule_value", precision = 15, scale = 4)
    private BigDecimal ruleValue;
    
    @Column(name = "is_active", nullable = false)
    private Boolean isActive = true;

    // Getters and Setters
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getRuleType() {
        return ruleType;
    }
    public void setRuleType(String ruleType) {
        this.ruleType = ruleType;
    }
    public String getRuleName() {
        return ruleName;
    }
    public void setRuleName(String ruleName) {
        this.ruleName = ruleName;
    }
    public BigDecimal getCondition() {
        return conditionValue;
    }
    public void setCondition(BigDecimal condition) {
        this.conditionValue = condition;
    }
    public Boolean getIsActive() {
        return isActive;
    }
    public void setIsActive(Boolean isActive) {
        this.isActive = isActive;
    }
	public BigDecimal getConditionValue() {
		return conditionValue;
	}
	public void setConditionValue(BigDecimal conditionValue) {
		this.conditionValue = conditionValue;
	}
	public BigDecimal getRuleValue() {
		return ruleValue;
	}
	public void setRuleValue(BigDecimal ruleValue) {
		this.ruleValue = ruleValue;
	}
}